home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-02-07 | 13.9 KB | 357 lines | [TEXT/MPS ] |
- UNIT UProcessGuts;
-
- {-------------------------------------------------------------------------------
- #
- # Apple Macintosh Developer Technical Support
- #
- # Interfaces for the guts of the ProcDoggie application
- #
- # Program: ProcDoggie
- # File: UProcessGuts.p - Pascal Implementation
- #
- # by: Forrest Tanaka
- #
- # Copyright © 1988-1991 Apple Computer, Inc.
- # All rights reserved.
- #
- --------------------------------------------------------------------------------
- #
- # Process Manager-related code that’s specific to ProcDoggie is contained in
- # this unit. Mainly, this code handles the user interface aspects of this
- # program that relate to the Process Manager, such as the Process List window,
- # the Process Information windows, and most of the menus.
- #
- # The Process List window displays a list of all active processes. It allows
- # the user to click on one or more of the process names and then use menu
- # commands to operate on those selected processes.
- #
- # Process Information windows display information about the selected active
- # processes. The information includes the process’s name, type, creator, SIZE
- # resource flags, partition size, and free memory availability.
- #
- # When the user chooses to launch an application, routines in this unit are
- # called to ask the user what process to launch and optionally what documents
- # to open or print, depending on the current launch mode.
- #
- # This unit also maintains the current launch mode. The launch mode indicates
- # whether the user wants to simply launch an application, launch an application
- # along with documents to open, and launch an application with documents to
- # print. The launch mode is global for this application, and affects the way
- # the menu commands that launch applications work.
- #
- -------------------------------------------------------------------------------}
- {[j=20/57/1$] Pasmat Options}
-
-
- INTERFACE
-
-
- (*******************************************************************************
- * Units
- *******************************************************************************)
-
- USES
- (* Group 1 *)
- Types
- ,QuickDraw
-
- (* Group 2 *)
- ,AppleEvents
- ,Controls
- ,Errors
- ,Events
- ,GestaltEqu
- ,Memory
- ,Menus
- ,OSUtils
- ,Resources
- ,SegLoad
- ,SysEqu
- ,ToolUtils
-
- (* Group 3 *)
- ,Aliases
- ,Files
- ,Lists
- ,Processes
- ,Script
- ,Windows
-
- (* Group 4 *)
- ,Dialogs
- ,Palettes
- ,StandardFile
-
- (* Group 5 *)
- ,Packages
-
- (* Application *)
- ,UGlobals
- ,UDialogUtils
- ,UEmergMem
- ,UProcessUtils
- ,UMenuHandler
- ,UProcessLDEF
- ;
-
-
- (*******************************************************************************
- * SetLaunchMode - Set the launch mode
- *
- * This routine is called to set the launching mode to the mode specified by the
- * "newMode" parameter. A launch mode of "kJustLaunch" simply launches an
- * application or desk accessory, "kOpenLaunch" launches an application with one
- * or more documents for the launched application to open, "kPrintLaunch"
- * launches an application with one or more documents for the launched
- * application to print. The launch modes are declared in UProcessUtils.p.
- *******************************************************************************)
-
- PROCEDURE SetLaunchMode (newMode: LaunchModeCode);
-
-
- (*******************************************************************************
- * GetLaunchMode - Get the launch mode
- *
- * The current launch mode is returned. For details about launching modes, see
- * the description of the SetLaunchMode routine.
- *******************************************************************************)
-
- FUNCTION GetLaunchMode: LaunchModeCode;
-
-
- (*******************************************************************************
- * IsProcessListWindow - Is a WindowPtr a pointer to a process list window?
- *
- * When I want to find out whether a window that I have a pointer to is a process
- * list window or not, I call this routine. It returns TRUE if aWindow is a
- * pointer to a process list window, FALSE if it isn’t. If aWindow is NIL, then
- * IsProcessListWindow returns FALSE.
- *******************************************************************************)
-
- FUNCTION IsProcessListWindow (aWindow: WindowPtr): Boolean;
-
-
- (*******************************************************************************
- * CreateProcessListWindow - Create a process list window
- *
- * This routine is called to create a new Process List window visible and
- * centered on the main screen. A pointer to the window is returned. If there
- * isn’t enough memory for the window, or if some other problem happened to make
- * it impossible to create the window, then CreateProcessListWindow puts up an
- * alert indicating this to the user, and then it returns NIL.
- *******************************************************************************)
-
- FUNCTION CreateProcessListWindow: WindowPtr;
-
-
- (*******************************************************************************
- * IdleProcessListWindow - Keep the process list window up to date
- *
- * IdleProcessListWindow updates the process list window specified by
- * processListWindow so that it reflects the status of the processes that are
- * currently open. It’s called once per main event loop iteration.
- *******************************************************************************)
-
- PROCEDURE IdleProcessListWindow (processListWindow: WindowPtr);
-
-
- (*******************************************************************************
- * DrawProcessListWindow - Draw the contents of the process list window
- *
- * Whenever an update event is received for the process list window, the routine
- * is called to draw into the window. Since the process list covers the entire
- * window, the only thing to be done is to call the List Manager to draw the
- * list. processListWindow is a pointer to the process list window.
- *******************************************************************************)
-
- PROCEDURE DrawProcessListWindow (processListWindow: WindowPtr);
-
-
- (*******************************************************************************
- * ClickProcessListWindow - Handle a mouse click in the process list window
- *
- * When a mouse click is detected in the content region of the process list
- * window specified by processListWindow, this routine is called to handle it.
- * It allows the user to select a process or several processes in the list. If
- * the user double-clicks on a process, then that process and any other selected
- * processes are brought to the front.
- *
- * clickEvent is the mouse-down event that was in the process list window.
- *******************************************************************************)
-
- PROCEDURE ClickProcessListWindow (processListWindow: WindowPtr;
- clickEvent: EventRecord);
-
-
- (*******************************************************************************
- * ActivateProcessListWindow - Handle an activate/deactivate event
- *
- * Whenever an activate or deactivate event is received for the process list
- * window specified by processListWindow, this routine is called to handle the
- * event. If the event was an activate event, then becomingActive is TRUE. If
- * the event was a deactivate event, then becomingActive is FALSE.
- *******************************************************************************)
-
- PROCEDURE ActivateProcessListWindow (processListWindow: WindowPtr;
- becomingActive: Boolean);
-
-
- (*******************************************************************************
- * FixProcessListMenus - Undim menu items for process list window
- *
- * Any menus that should be available when the process list window is in front
- * are undimmed if the current conditions are appropriate.
- *******************************************************************************)
-
- PROCEDURE FixProcessListMenus (processListWindow: WindowPtr);
-
-
- (*******************************************************************************
- * IsProcessInfoWindow - Is a WindowPtr a pointer to a process info window?
- *
- * When I want to find out whether a window that I have a pointer to is a process
- * info window or not, I call this routine. It returns TRUE if aWindow is a
- * pointer to a process info window, FALSE if it isn’t. If aWindow is NIL, then
- * IsProcessInfoWindow returns NIL.
- *******************************************************************************)
-
- FUNCTION IsProcessInfoWindow (aWindow: WindowPtr): Boolean;
-
-
- (*******************************************************************************
- * IdleProcessInfoWindow - Give the specified process info window some idle time
- *
- * This routine is called once per event loop iteration. It gives the specified
- * process info window some idle time to update the memory indicator.
- *******************************************************************************)
-
- PROCEDURE IdleProcessInfoWindow (processInfoWindow: WindowPtr);
-
-
- (*******************************************************************************
- * DrawProcessInfoWindow - Draw the contents of the process info window
- *
- * Whenever an update event is received for the process info window, the routine
- * is called to draw the static items into the window.
- *******************************************************************************)
-
- PROCEDURE DrawProcessInfoWindow (processInfoWindow: WindowPtr);
-
-
- (*******************************************************************************
- * FixProcessInfoMenus - Undim menu items for process information window
- *
- * Any menus that should be available when a process information window is in
- * front are undimmed if the current conditions are appropriate.
- *******************************************************************************)
-
- PROCEDURE FixProcessInfoMenus (processInfoWindow: WindowPtr);
-
-
- (*******************************************************************************
- * CloseProcessInfoWindow - Close a process info window
- *
- * The process info window specified by "processInfoWindow" is closed and all its
- * associated memory is deallocated.
- *******************************************************************************)
-
- PROCEDURE CloseProcessInfoWindow (processInfoWindow: WindowPtr);
-
-
- (*******************************************************************************
- * IdleAllProcessWindows - Give every open process window idle time
- *
- * IdleAllProcessWindows is called to give the process list window and all open
- * process info windows some idle time. This routine is called once per main
- * event loop iteration.
- *******************************************************************************)
-
- PROCEDURE IdleAllProcessWindows;
-
-
- (*******************************************************************************
- * DoLaunchInFront - Launch a process to the front
- *
- * When the user wants to launch a process and have it brought to the front, this
- * routine is called. It allows the user to choose a process through Standard
- * File. That application is then launched and brought to the front.
- *******************************************************************************)
-
- PROCEDURE DoLaunchInFront;
-
-
- (*******************************************************************************
- * DoLaunchInBack - Launch a process to the back
- *
- * When the user wants to launch a process and have it sent to the back of all of
- * the open processes, this routine is called. It allows the user to choose a
- * process through Standard File. That process is then launched and sent to the
- * back.
- *******************************************************************************)
-
- PROCEDURE DoLaunchInBack;
-
-
- (*******************************************************************************
- * DoLaunchTo - Launch a process and terminate self
- *
- * When the user wants to launch a process and then immediately quit ProcDoggie,
- * this routine is called. It allows the user to choose a process through
- * Standard File. That process is then launched and brought to the front, and
- * then ProcDoggie is immediately terminated.
- *******************************************************************************)
-
- PROCEDURE DoLaunchTo;
-
-
- (*******************************************************************************
- * DoLaunchMode - Handle Simple Launch, Open on Launch, Print on Launch commands
- *
- * This routine is called when a launch mode menu item is chosen. The launch
- * mode items are in the file menu and are the “Simple Launch,” “Open Documents
- * on Launch,” and “Print Documents on Launch” items.
- *******************************************************************************)
-
- PROCEDURE DoLaunchMode (modeItem: Integer);
-
-
- (*******************************************************************************
- * DoBringProcessToFront - Bring an open process to the front
- *
- * When the user chooses the Bring to Front menu item, this routine is called to
- * bring all the selected process to the front in the order that they appear in
- * the process list window specified by processListWindow. For the moment, it
- * won’t bring it’s own application (ProcDoggie) to the front. I don’t know how
- * or whether I’ll be able to fix that.
- *******************************************************************************)
-
- PROCEDURE DoBringProcessToFront (processListWindow: WindowPtr);
-
-
- (*******************************************************************************
- * DoGetProcessInfo - Get information about selected processes
- *
- * This routine is called when the user desires information about the processes
- * selected in the process list window specified by the "processListWindow"
- * parameter.
- *******************************************************************************)
-
- PROCEDURE DoGetProcessInfo (processListWindow: WindowPtr);
-
-
- (*******************************************************************************
- * DoTerminateProcess - Terminate the selected processes
- *
- * This routine is called when the user wants to terminate the processes selected
- * in the process list window specified by the "processListWindow" parameter.
- *******************************************************************************)
-
- PROCEDURE DoTerminateProcess (processListWindow: WindowPtr);
-
-
- IMPLEMENTATION
-
- {$I UProcessGuts.inc1.p}
-
- END.
-